package com.pencilisland.pay.api.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 商品实体
 * 
 * @author Breeze
 *
 */
@Entity
@Table(name = "PI_GOODS")
public class GoodsEntity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 主键
	 */
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	/**
	 * 商品编号
	 */
	@Column(name = "CODE", length = 100)
	private String code;
	/**
	 * 商品名称
	 */
	@Column(name = "NAME", length = 100)
	private String name;
	/**
	 * 商品描述
	 */
	@Lob
	@Column(name = "REMARK")
	private String remark;
	/**
	 * 商品单价
	 */
	@Column(name = "PRICE", scale = 2, precision = 16)
	private BigDecimal price;
	/**
	 * 库存
	 */
	@Column(name = "STOCK")
	private Integer stock;
	
	/**
	 * 是否包邮
	 */
	@Column(name = "FREE_POST",length=10)
	private String freePost;

	/**
	 * 商户ID
	 */
	@Column(name = "MERCHANT_ID")
	private String merchantId;
	/**
	 * 当前状态
	 */
	@Column(name = "STATUS")
	private Integer status;
	/**
	 * 更新时间
	 */
	@Column(name = "UPDATE_TIME", length = 20)
	private String updateTime;
	/**
	 * 排序权重
	 */
	@Column(name = "WEIGHT")
	private Integer weight;
	
	@Transient
	private List<GoodsImgEntity> imgDetails;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getStock() {
		return stock;
	}

	public void setStock(Integer stock) {
		this.stock = stock;
	}

	public String getFreePost() {
		return freePost;
	}

	public void setFreePost(String freePost) {
		this.freePost = freePost;
	}

	public String getMerchantId() {
		return merchantId;
	}

	public void setMerchantId(String merchantId) {
		this.merchantId = merchantId;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	public List<GoodsImgEntity> getImgDetails() {
		return imgDetails;
	}

	public void setImgDetails(List<GoodsImgEntity> imgDetails) {
		this.imgDetails = imgDetails;
	}

	public Integer getWeight() {
		return weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}
}
